import ccb from '../components/svg/ccb';
import icbc from '../components/svg/icbc';
import bankOfDalian from '../components/svg/bankOfDalian';
import ceb from '../components/svg/ceb';
import psbc from '../components/svg/psbc';
import abc from '../components/svg/abc';
import boc from '../components/svg/boc';
import cmbc from '../components/svg/cmbc';
import cmb from '../components/svg/cmb';
import cib from '../components/svg/cib';
import bcm from '../components/svg/bcm';
import citic from '../components/svg/citic';
import gdb from '../components/svg/gdb';
import spdb from '../components/svg/spdb';
import srcb from '../components/svg/srcb';
import hxb from '../components/svg/hxb';
import pingAnBank from '../components/svg/pingAnBank';
import bankOfShangHai from '../components/svg/bankOfShangHai';
import bob from '../components/svg/bob';
import bankOfJangSu from '../components/svg/bankOfJangSu';
import njcb from '../components/svg/njcb';
import nbcb from '../components/svg/nbcb';
import bankCard from '../components/svg/bankCard';

/**
 * @author 田尘殇Sean(sean.snow@live.com)
 * @date 2017/3/28
 */
export const config = {
  CCB: {
    name: 'ccb',
    icon: ccb,
    label: '建设银行',
    creditCardApplyProgress: {
      source: {uri: 'http://m.ccb.com/cn/mobile/index.html'},
      injectedJavaScript: `
      document.getElementsByClassName('search_list content')[0].lastElementChild.click();
      `
    },
    creditCardActive: {
      web: 'http://creditcard.ccb.com/cn/creditcard/crd_activation.html'
    },
    colors: ['#366f97'],
    serviceTel: '95533',
    serviceTelTip: '拨打95533',
    creditCardServiceTel: '95533',
    creditCardServiceTelTip: '拨打95533->按2->信用卡业务',
    reportedLossTip: '拨打95533->按1->按3->根据提示完成挂失',
    creditCardReportedLossTip: '拨打95533->按2->按5->根据提示完成挂失',
    queryCreditLimit: cardNo => `CCED#${cardNo.substring(cardNo.length - 4)}`,
    queryPoints: cardNo => `CCJF#${cardNo.substring(cardNo.length - 4)}`
  },
  ICBC: {
    name: 'icbc',
    icon: icbc,
    label: '工商银行',
    creditCardApplyProgress: '',
    creditCardActive: {
      tel: '拨打95588->按6->输入信用卡卡号'
    },
    colors: ['#dc695f'],
    serviceTel: '95588',
    serviceTelTip: '拨打95588',
    creditCardServiceTel: '95588',
    creditCardServiceTelTip: '拨打95588->按6->信用卡服务',
    reportedLossTip: '拨打95588->按2->根据提示完成挂失',
    creditCardReportedLossTip: '拨打95588->按2->根据提示完成挂失'
  },
  BANK_OF_DALIAN: {
    name: 'bankOfDalian',
    icon: bankOfDalian,
    label: '大连银行',
    colors: ['#c0675f'],
    serviceTel: '4006640099',
    serviceTelTip: '拨打400-664-0099',
    creditCardServiceTel: '4006640099',
    creditCardServiceTelTip: '拨打400-664-0099->按3->信用卡业务',
    reportedLossTip: '拨打400-664-0099->按0->根据提示完成挂失',
    creditCardReportedLossTip: '拨打400-664-0099->按0->根据提示完成挂失',
    queryCreditLimit: {
      getBody: cardNo => `ED${cardNo.substring(cardNo.length - 4)}`,
      tel: '1065752574896699'
    },
    queryPoints: {
      getBody: cardNo => `JF${cardNo.substring(cardNo.length - 4)}`,
      tel: '1065752574896699'
    }
  },
  CEB: {
    name: 'ceb',
    icon: ceb,
    label: '光大银行',
    creditCardApplyProgress: 'https://xyk.cebbank.com/cebmms/apply/fz/wy-apply-index.htm',
    creditCardActive: {
      tel: '拨打400-788-8888->按2->输入卡号后4位'
    },
    colors: ['#AB24D4'],
    serviceTel: '95595',
    serviceTelTip: '拨打95595',
    creditCardServiceTel: '4007888888',
    creditCardServiceTelTip: '拨打400-788-8888',
    creditCardReportedLossTip: '拨打4007888888->按0->按1->卡号和查询密码->人工服务',
    queryCreditLimit: cardNo => `额度#${cardNo.substring(cardNo.length - 4)}`,
    queryPoints: cardNo => `积分#${cardNo.substring(cardNo.length - 4)}`
  },
  PSBC: {
    name: 'psbc',
    icon: psbc,
    label: '邮政储蓄银行',
    colors: ['#5f8d69'],
    serviceTel: '95580',
    serviceTelTip: '拨打95580',
    creditCardServiceTel: '4008895580',
    creditCardServiceTelTip: '拨打400-88-95580',
    reportedLossTip: '拨打95580->按2->根据提示完成挂失',
    creditCardReportedLossTip: '拨打400-88-95580->按1->根据提示完成挂失',
    queryCreditLimit: cardNo => `EDCX#${cardNo.substring(cardNo.length - 4)}`,
    queryPoints: cardNo => `JFCX#${cardNo.substring(cardNo.length - 4)}`
  },
  ABC: {
    name: 'abc',
    icon: abc,
    label: '农业银行',
    creditCardApplyProgress: 'https://eapply.abchina.com/CreditCardApp/CreditcardsInfo/CreditSearch',
    creditCardActive: {
      sms: {
        recipient: '1069095599',
        content: 'CCKPJH#卡号后四位#证件号后六位#卡片背面签名栏末三位数'
      }
    },
    colors: ['#63a18f'],
    serviceTel: '95599',
    serviceTelTip: '拨打95599',
    creditCardServiceTel: '4006695599',
    creditCardServiceTelTip: '拨打400-66-95599',
    reportedLossTip: '拨打95599->按2->根据提示完成挂失',
    creditCardReportedLossTip: '拨打95599->按2->根据提示完成挂失'
  },
  BOC: {
    name: 'boc',
    icon: boc,
    label: '中国银行',
    creditCardApplyProgress: 'https://apply.mcard.boc.cn/apply/mobile/mainAppi/showScheduleQuery',
    creditCardActive: {
      tel: '拨打400-66-95566->按2->按提示开卡'
    },
    colors: ['#b66565' ],
    serviceTel: '95566',
    serviceTelTip: '拨打95566',
    creditCardServiceTel: '4006695566',
    creditCardServiceTelTip: '拨打400-66-95566',
    reportedLossTip: '拨打95566->按1->根据提示完成挂失',
    creditCardReportedLossTip: '拨打400-66-95566->按#->根据提示完成挂失',
    queryCreditLimit: cardNo => `XYKZMED#${cardNo.substring(cardNo.length - 4)}`,
    queryPoints: cardNo => `XYKDQJF#${cardNo.substring(cardNo.length - 4)}`
  },
  CMBC: {
    name: 'cmbc',
    icon: cmbc,
    label: '民生银行',
    creditCardApplyProgress: 'https://creditcard.cmbc.com.cn/home/cn/wap/business/account/progress/index.shtml',
    creditCardActive: {
      web: 'https://creditcard.cmbc.com.cn/home/cn/wap/business/account/activated/index.shtml'
    },
    colors: ['#5eb0cc'],
    serviceTel: '95568',
    serviceTelTip: '拨打95568',
    creditCardServiceTel: '4006695568',
    creditCardServiceTelTip: '拨打400-66-95568',
    reportedLossTip: '拨打95568->按1->按#->按3->根据提示完成挂失',
    creditCardReportedLossTip: '拨打400-66-95568->按1->按->根据提示完成挂失',
    queryCreditLimit: {
      getBody: cardNo => `ED${cardNo.substring(cardNo.length - 4)}`,
      tel: '1065752574895568'
    },
    queryPoints: {
      getBody: cardNo => `JF#${cardNo.substring(cardNo.length - 4)}`,
      tel: '1065752574895568'
    }
  },
  CMB: {
    name: 'cmb',
    icon: cmb,
    label: '招商银行',
    creditCardApplyProgress: 'https://ccclub.cmbchina.com/mca/MQuery.aspx',
    creditCardActive: {
      web: 'https://xyk.cmbchina.com/activate'
    },
    colors: ['#d9675b'],
    serviceTel: '95555',
    serviceTelTip: '拨打95555',
    creditCardServiceTel: '4008205555',
    creditCardServiceTelTip: '拨打400-820-5555',
    reportedLossTip: '拨打95555->按4->根据提示完成挂失',
    creditCardReportedLossTip: '拨打400-820-5555->按2#->根据提示完成挂失',
    queryCreditLimit: '#ED',
    queryPoints: '#JF'
  },
  CIB: {
    name: 'cib',
    icon: cib,
    label: '兴业银行',
    creditCardApplyProgress: 'https://3g.cib.com.cn/app/00282.html',
    creditCardActive: {
      web: 'https://3g.cib.com.cn/app/00281.html'
    },
    colors: ['#35719e'],
    serviceTel: '95561',
    serviceTelTip: '拨打95561',
    creditCardServiceTel: '4008895561',
    creditCardServiceTelTip: '拨打400-889-5561',
    reportedLossTip: '拨打95561->按7->根据提示完成挂失',
    creditCardReportedLossTip: '拨打400-889-5561->根据提示完成挂失',
    queryCreditLimit: cardNo => `CCZW ${cardNo.substring(cardNo.length - 4)}`,
    queryPoints: cardNo => `30${cardNo.substring(cardNo.length - 4)}`
  },
  BCM: {
    name: 'bcm',
    icon: bcm,
    label: '交通银行',
    creditCardApplyProgress: 'https://creditcardapp.bankcomm.com/member/apply/status/preinquiry.html',
    creditCardActive: {
      web: 'https://creditcardapp.bankcomm.com/member/card/activation/index.html'
    },
    colors: ['#4a6592'],
    serviceTel: '95559',
    serviceTelTip: '拨打95559',
    creditCardServiceTel: '4008009888',
    creditCardServiceTelTip: '拨打400-800-9888',
    reportedLossTip: '拨打95559->按4->根据提示完成挂失',
    creditCardReportedLossTip: '拨打400-800-9888->按1#->根据提示完成挂失',
    queryCreditLimit: cardNo => `cc额度#${cardNo.substring(cardNo.length - 4)}`,
    queryPoints: cardNo => `cc积分#${cardNo.substring(cardNo.length - 4)}`
  },
  CITIC: {
    name: 'citic',
    icon: citic,
    label: '中信银行',
    creditCardApplyProgress: 'https://creditcard.ecitic.com/citiccard/wap/cardappquery/app_inq.jsp',
    creditCardActive: {
      web: 'https://creditcard.ecitic.com/citiccard/ebankwap/opencard/open_card.html'
    },
    colors: ['#c96359'],
    serviceTel: '95558',
    serviceTelTip: '拨打95558',
    creditCardServiceTel: '4008895558',
    creditCardServiceTelTip: '拨打400-88-95558',
    reportedLossTip: '拨打95558->按1->按1->根据提示完成挂失',
    creditCardReportedLossTip: '拨打400-88-95558->按2#->根据提示完成挂失',
    queryPoints: {
      getBody: cardNo => `JF${cardNo.substring(cardNo.length - 4)}`,
      tel: '106980095558'
    }
  },
  GDB: {
    name: 'gdb',
    icon: gdb,
    label: '广发银行',
    creditCardApplyProgress: 'https://wap.cgbchina.com.cn/queryApply.do',
    creditCardActive: {
      web: 'https://wap.cgbchina.com.cn/cardActivateUnlogInput.do?JSESSIONID=0000PHsSS2EUfq3XfUlX89mkyxQ:1atntq0aj&sid=0.9792584932286579'
    },
    colors: ['#db6964'],
    serviceTel: '95508',
    serviceTelTip: '拨打95508',
    creditCardServiceTel: '95508',
    creditCardServiceTelTip: '拨打95508',
    reportedLossTip: '拨打95508->按1#->根据提示完成挂失',
    creditCardReportedLossTip: '拨打95508->按1#->根据提示完成挂失',
    queryCreditLimit: cardNo => `XED${cardNo.substring(cardNo.length - 4)}`,
    queryPoints: cardNo => `XJF${cardNo.substring(cardNo.length - 4)}`
  },
  SPDB: {
    name: 'spdb',
    icon: spdb,
    label: '浦发银行',
    creditCardApplyProgress: 'http://www.spdbccc.com.cn/spdb/cupd/applyProgress.do?method=index',
    creditCardActive: {
      web: 'https://cardsonline.spdbccc.com.cn/icard/LineActivationInput.do?_locale=zh_CN'
    },
    colors: ['#456596'],
    serviceTel: '95528',
    serviceTelTip: '拨打95528',
    creditCardServiceTel: '95528',
    creditCardServiceTelTip: '拨打95528',
    reportedLossTip: '拨打95528->按3->根据提示完成挂失',
    creditCardReportedLossTip: '拨打95528->按3->根据提示完成挂失',
    queryPoints: cardNo => `JFCX ${cardNo.substring(cardNo.length - 4)}`
  },
  SRCB: {
    name: 'srcb',
    icon: srcb,
    label: '上海农商银行',
    colors: ['#346ead'],
    serviceTel: '4006962999',
    serviceTelTip: '拨打400-696-2999',
    creditCardServiceTel: '4006962999',
    creditCardServiceTelTip: '拨打400-696-2999->按1',
    reportedLossTip: '拨打400-696-2999->按4->根据提示完成挂失',
    creditCardReportedLossTip: '拨打400-696-2999->按4->根据提示完成挂失'
  },
  HXB: {
    name: 'hxb',
    icon: hxb,
    label: '华夏银行',
    creditCardApplyProgress: 'https://creditcloud.hxb.com.cn/hxypt/CridetCardApplySchedule.do',
    creditCardActive: {
      sms: {
        recipient: '1069000795577',
        content: 'JH卡号后四位'
      }
    },
    colors: ['#d5675b'],
    serviceTel: '95577',
    serviceTelTip: '拨打95577',
    creditCardServiceTel: '400-66-95577',
    creditCardServiceTelTip: '拨打4006695577',
    reportedLossTip: '拨打95577->按3->按1->根据提示完成挂失',
    creditCardReportedLossTip: '拨打400-66-95577->按3#->根据提示完成挂失',
    queryCreditLimit: {
      getBody: cardNo => `YE${cardNo.substring(cardNo.length - 4)}`,
      tel: '106902895577'
    },
    queryPoints: {
      getBody: cardNo => `YE${cardNo.substring(cardNo.length - 4)}`,
      tel: '106902895577'
    }
  },
  PING_AN_BANK: {
    name: 'pingAnBank',
    icon: pingAnBank,
    label: '平安银行',
    creditCardApplyProgress: 'https://c.pingan.com/apply/mobile/modules/queryApp/index.html#queryf',
    creditCardActive: {
      sms: {
        recipient: '9551186',
        content: 'JH+卡末4位+证件号码末四位+有效期'
      }
    },
    colors: ['#e98151'],
    serviceTel: '95511',
    serviceTelTip: '拨打95511->按3->全国24小时服务热线',
    creditCardServiceTel: '95511',
    creditCardServiceTelTip: '拨打95511->按2',
    reportedLossTip: '拨打95511->根据提示完成挂失',
    creditCardReportedLossTip: '拨打95511->根据提示完成挂失'
  },
  SHCB: {
    name: 'bankOfShangHai',
    icon: bankOfShangHai,
    label: '上海银行',
    creditCardApplyProgress: 'https://ebanks.bankofshanghai.com/pweb/LogoutCreditApplyProQryPre.do?_locale=zh_CN',
    colors: ['#516f9b'],
    serviceTel: '95594',
    serviceTelTip: '拨打95594',
    creditCardServiceTel: '95594',
    creditCardServiceTelTip: '拨打95594->按3',
    reportedLossTip: '拨打95594->按1->根据提示完成挂失',
    creditCardReportedLossTip: '拨打95594->按1->根据提示完成挂失'
  },
  CZBANK: {
    name: 'czBank',
    label: '浙商银行',
    colors: ['#e1614d'],
    serviceTel: '95527',
    serviceTelTip: '拨打95527',
    creditCardServiceTel: '95527',
    creditCardServiceTelTip: '拨打95527->按3',
    reportedLossTip: '拨打95527->按4->根据提示完成挂失',
    creditCardReportedLossTip: '拨打95527->按4->根据提示完成挂失'
  },
  BOB: {
    name: 'bob',
    icon: bob,
    label: '北京银行',
    creditCardApplyProgress: 'https://onlinepay.cupdata.com/weixin/apply.do?action=applyProgressInit&bankNum=6403&userId=true',
    colors: ['#d76a5d'],
    serviceTel: '95526',
    serviceTelTip: '拨打95526',
    creditCardServiceTel: '4006-601169',
    creditCardServiceTelTip: '拨打4006-601169',
    reportedLossTip: '拨打95526->按2->根据提示完成挂失',
    creditCardReportedLossTip: '拨打4006-601169->按1#->根据提示完成挂失'
  },
  BANK_OF_JANGSU: {
    name: 'bankOfJangSu',
    icon: bankOfJangSu,
    label: '江苏银行',
    colors: ['#337cb5'],
    serviceTel: '95319',
    serviceTelTip: '拨打95319',
    creditCardServiceTel: '95319',
    creditCardServiceTelTip: '拨打95319->按3',
    reportedLossTip: '拨打95319->按1->根据提示完成挂失',
    creditCardReportedLossTip: '拨打95319->按1->根据提示完成挂失'
  },
  NJCB: {
    name: 'njcb',
    icon: njcb,
    label: '南京银行',
    colors: ['#ed654e'],
    serviceTel: '4008896400',
    serviceTelTip: '拨打400-889-6400',
    creditCardServiceTel: '4008896400',
    creditCardServiceTelTip: '拨打4008896400->按6',
    reportedLossTip: '拨打400-889-6400->按3->根据提示完成挂失',
    creditCardReportedLossTip: '拨打400-889-6400->按3->根据提示完成挂失'
  },
  NBCB: {
    name: 'nbcb',
    icon: nbcb,
    label: '宁波银行',
    colors: ['#ffca55'],
    serviceTel: '95574',
    serviceTelTip: '拨打95574',
    creditCardServiceTel: '95574',
    creditCardServiceTelTip: '拨打95574->按2',
    reportedLossTip: '拨打95574->按4->根据提示完成挂失',
    creditCardReportedLossTip: '拨打95574->按4->根据提示完成挂失'
  }
};

export const defaultConfig = {
  name: 'bankCard',
  icon: bankCard,
  colors: ['#3d5eab', '#4f81be'],
  label: ''
};

export function getConfig(issuer) {
  return config[issuer] || defaultConfig;
}

